package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.entity.entity.Weibo;
import cn.tedu._04mybatis.pojo.entity.vo.ResultMapVO1;
import cn.tedu._04mybatis.pojo.entity.vo.ResultMapVO2;
import cn.tedu._04mybatis.pojo.entity.vo.ResultMapVO4;
import cn.tedu._04mybatis.pojo.entity.vo.ResultMapVo3;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WeiboMapper {
    /**
     * 1.增:微博表中插入1条数据
     * 增删改操作:返回值为int
     * 注意: #{}是占位符, #{属性名}是获取实体类属性值
     */
    //@Insert("INSERT INTO weibo(content,created,user_id) VALUES (#{content},#{created},#{userId})")
    int insertWeibo(Weibo weibo);

    /**
     * 2.删:微博表中删除1条数据[根据微博id];
     */
    //@Delete("DELETE FROM weibo WHERE id=#{wid}")
    int deleteWeiboById(Long wid);

    //3.查询多条数据部分字段查询
    //@Select("SELECT id,content,created FROM weibo ")
    List<Weibo> selectWeiboVO1ById();

    int dynamicUpdate(Weibo weibo);


    int deleteWeiboByIds1(Long[] ids);

    int deleteWeiboByIds2(List<Long> ids);


    int countWeibo();

    ResultMapVO1 selectMap1(Long wid);

    ResultMapVO2 selectMap2(Long uid);

    ResultMapVo3 selectMap3(Long wid);

    ResultMapVO4 selectMap4(Long wid);



}







